/**
 * Created by Shinelon on 2017/2/14.
 */
var express = require('express'),
    router = express.Router(),
    home = require('../controller/home'),
    image = require('../controller/image');

module.exports = function (app) {
    router.get('/', home.index);
    router.get('/images/:image_id', image.index);
    router.post('/images', image.create);
    router.post('/images/:image_id/like', image.like);
    router.post('/images/:image_id/comment', image.comment);

    //调用router模块，会将所有这些路由附加到应用程序实例中
    app.use(router);
}
